/** 
 * DeleteClassFile.java
 * @author Lex
 * Create: 2007-8-16 ����08:24:24
 *
 * Note: 
 */
package org.lex.io.filesystem.tools;

import java.io.File;

import org.lex.filter.Filter;
import org.lex.io.filesystem.traveller.FileTraveller;


public class DeleteClassFile extends FileTraveller {
	public static void main(String[] args) {
		new DeleteClassFile("F:\\My Projects\\Java\\CG\\src").run();
	}

	public DeleteClassFile(String dir) {
		super(new File(dir), new ClassFileFilter(), new DeleteFileOperator());
	}
}

class ClassFileFilter implements Filter<File> {
	public boolean accept(File file) {
		if (null == file || false == file.exists() || false == file.isFile())
			return false;
		String name = file.getName();
		return name.endsWith(".class");
	}
}
